/**
 * 
 */
package com.huangliusong;

/**
 * @author huangliusong E-mail:huangliusong1994@gmail.com
 * @version 创建时间：2018年7月17日 上午9:45:20 类说明
 */
public class Tests {
	public static void main(String[] args) {
		test1();
	}

	public static void test1() {
		// 单位: 毫秒
		final long timeInterval = 5000;
		Runnable runnable = new Runnable() {
			public void run() {
				while (true) {
					// ------- code for task to run
					System.out.println("Hello !!");
					// ------- ends here
					try {
						Thread.sleep(timeInterval);
					} catch (InterruptedException e) {
						e.printStackTrace();
					}
				}
			}
		};
		Thread thread = new Thread(runnable);
		thread.start();
	}
}
